-
-
Notifications
You must be signed in to change notification settings - Fork 165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a session flash and use it to pass status messages for redirects. #2337
Add a session flash and use it to pass status messages for redirects. #2337
Conversation
82adb4a
to
1929b8c
Compare
b276f80
to
b8d8db0
Compare
b8d8db0
to
901c933
Compare
901c933
to
6683ea6
Compare
Can you suggest anything specific to test here? Or just switch to the branch and see that logging in with cookies works fine? |
ef6f424
to
d1486bc
Compare
That is of course something that should still work correctly. So that is something to test. The main thing that this deals with is the Note that there is one message you won't see if you are saving a new problem from the PG problem editor opened from the site navigation menu. That is the message "No changes have been made to set". You will of course still see that if you are saving when editing a problem from a set (and not modifying the set), and then it will say "No changes have been made to set setID". An important thing to test is what is stated in issue #2336. With the develop branch if you enter |
fe6e868
to
0785b70
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This all tested out. I have no issues with maintaining a cookie based session. The messages are no longer in the URL. The one message mentioned is no longer there when it shouldn't be. And the scripting test no longer printed anything in the console log.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested the status_messages are either no longer added to the URL as a query string and if they exist, they are not parsed.
The session `flash` method is similar to the `session` method added previously, and is a method of the WeBWorK::Authen object attached to the controller. It uses the `flash` method of `Mojolicious::Plugin::DefaultHelpers` if `session_management_via` is "session_cookie" and imitates that with the database session otherwise. This method saves data to the session that will persist only for the next request. This is then used to save `status_messages` when redirects occur. This fixes issue openwebwork#2336, since the `status_message` URL parameter is no longer used. We need to make sure that we never again use a URL parameter to pass HTML.
0785b70
to
1354fc4
Compare
The session
flash
method is similar to thesession
method added previously, and is a method of the WeBWorK::Authen object attached to the controller. It uses theflash
method ofMojolicious::Plugin::DefaultHelpers
ifsession_management_via
is "session_cookie" and imitates that with the database session otherwise. This method saves data to the session that will persist only for the next request.This is then used to save
status_messages
when redirects occur. This fixes issue #2336, since thestatus_message
URL parameter is no longer used. We need to make sure that we never again use a URL parameter to pass HTML.This builds on #2333, #2334, and #2335 and is part 4 of 3 of the authentication system revamp. So long, and thanks for all the fish!